package com.finance.system.service;

import com.finance.framework.lang.Page;
import com.finance.framework.lang.PageResultBO;
import com.finance.system.bean.pojo.Logistics;
import com.finance.system.dao.LogisticsManageMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: gly
 * @Date: Created in 2017/05/15
 */
@Service
public class LogisticsManageService implements ILogisticsManageService {
    @Autowired
    private LogisticsManageMapper logisticsManageMapper;


    @Override
    public PageResultBO<Logistics> listByPage(Page page) {
        PageResultBO<Logistics> pageResultBO = new PageResultBO<Logistics>();
        List<Logistics> logisticsList = logisticsManageMapper.listByPage(page);
        pageResultBO.setPageSize(page.getPageSize());
        pageResultBO.setPageNo(page.getPageNo());
        pageResultBO.setTotalRecord(page.getTotalRecord());
        pageResultBO.setDataList(logisticsList);
        return pageResultBO;
    }

    @java.lang.Override
    public Logistics getById(Long id,String tableName) {
        return logisticsManageMapper.getById(id,tableName);
    }

    @java.lang.Override
    public boolean update(Logistics logistics,String tableName) {
        return logisticsManageMapper.update(logistics,tableName)==1;
    }

    @Override
    public Logistics getDetailById(String dataTableName, String extendTableName, Long id){
        return logisticsManageMapper.getDetailById(dataTableName,extendTableName,id);
    }
}
